package testRankers;

import java.util.ArrayList;

import junit.framework.TestCase;

import vsvm.data.model.AbstractAttribute;
import vsvm.data.model.AbstractDataModel;
import vsvm.data.model.GenericDataModel;
import vsvm.data.source.DelimitedFileDataSource;

public class AbstractRankerTest extends TestCase
{	
	protected String mainPath = "unittests/testRankers/";
	protected AbstractDataModel getDataModel(String path, int classAttr)
	{
		DelimitedFileDataSource dataSource = new DelimitedFileDataSource(path);	
		AbstractDataModel dataModel = null;
		dataSource.open();
		try 
		{
			ArrayList<AbstractAttribute> lst = dataSource.readAttributes();
			dataModel = new GenericDataModel();
			
			dataSource.setAttributes(lst);
			dataSource.fill(dataModel, lst.get(classAttr));
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		dataSource.close();

		return dataModel;
	}

}
